package org.ehe.erp.domain.product.bo;

import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.ehe.common.mybatis.core.domain.BaseEntity2;
import org.ehe.erp.domain.product.ErpMaterial;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import java.time.LocalDateTime;

/**
 * @author :zhangnn
 * @className :ErpMaterialBo
 * @description: TODO
 * @date 2025-09-08 14:27:07
 */
@Data
@AutoMapper(target = ErpMaterial.class,reverseConvertGenerate = false)
public class ErpMaterialBo extends BaseEntity2 {
    private Long id;

    @Pattern(regexp = "^[0-9]{2}$", message = "材料编码必须为2位数字")
    private String materialCode;

    @NotBlank(message = "材料名称不能为空")
    @Length(max = 50, message = "材料名称长度不能超过50字符")
    private String materialName;

    private Integer sortOrder = 0;

    @Range(min = 0, max = 1, message = "状态值必须为0或1")
    private Integer status;

    @Length(max = 200, message = "备注长度不能超过200字符")
    private String remark;
}
